
<template>
  <div id="app">
    <img src="./assets/logo.png">
    <div>
      <el-button @click="startHacking">Start</el-button>
      <h1>{{getData}}</h1>
    </div>
    <button @click="add(1)">点击</button>
    <button @click="actionA(3)">点击是什么鬼</button>
    <button @click="incommnet">moduleA 点击</button>
  </div>
</template>

<script>
import { mapState, mapGetters,mapMutations,mapActions } from 'vuex'
import {SOME_MUTATION} from './mutaion-types'
export default {
  state :{
  username: 1
  },
  methods: {
    startHacking () {
      this.$notify({
        title: 'It works!',
        type: 'success',
        message: 'We\'ve laid the ground work for you. It\'s time for you to build something epic!',
        duration: 5000
      })
    },
    ...mapMutations({
     search: 'SOME_MUTATION',
     add:'inreatment'
    }),
    ...mapActions({ //this.$store.dispatch('inreatment')
      actionA:'actionInreacte',
      incommnet:'moduleA/sumWithRootCount'
    })
  },
  computed: {
     countPlushte () {
        return this.$store.state.count + this.$store.getters.doLength
      },
      findByInd (){
        return this.$store.getters.getListById(1)
      },
    ...mapState({
      countJell:state => state.count
    }),
    ...mapGetters({
      doLength:'doLength',
      getData: 'moduleA/sumWithRootCount'
    })
   
  }
}
</script>

<style>
#app {
  font-family: Helvetica, sans-serif;
  text-align: center;
}
</style>
